it should "convert SELECT into a LogicalPlan" in { val parsedPlan = sparkSession.sessionState.sqlParser.parsePlan("SELECT * FROM numbers WHERE nr > 1")
parsedPlan.toString() should include ("'Project [*]") parsedPlan.toString() should include ("+- 'Filter ('nr > 1)") parsedPlan.toString() should include (" +- 'UnresolvedRelation `numbers`") }
it should "convert filter into an Expression" in { val parsedExpression = sparkSession.sessionState.sqlParser.parseExpression("nr > 1")
parsedExpression shouldBe a [GreaterThan] parsedExpression.asInstanceOf[GreaterThan].left shouldBe a [UnresolvedAttribute] parsedExpression.asInstanceOf[GreaterThan].right shouldBe a [Literal] }
it should "convert data type into Spark StructType" in { val parsedType = sparkSession.sessionState.sqlParser.parseDataType("struct")